﻿//LT 2018.4.4
using UnityEngine;
using GameFramework.Resource;
using System;

namespace UnityGameFramework.Runtime
{
    /// <summary>
    /// 资源辅助器基类
    /// </summary>
    public abstract class ResourceHelperBase : MonoBehaviour, IResourceHelper
    {
        /// <summary>
        /// 直接从指定文件路径读取数据流
        /// </summary>
        /// <param name="fileUri">文件路径</param>
        /// <param name="loadBytesCallback">读取数据流回调函数</param>
        public abstract void LoadBytes(string fileUri, LoadBytesCallback loadBytesCallback);

        /// <summary>
        /// 释放资源
        /// </summary>
        /// <param name="objectToRelease">要释放的资源</param>
        public abstract void Release(object objectToRelease);

        /// <summary>
        /// 卸载场景。
        /// </summary>
        /// <param name="sceneAssetName">场景资源名称</param>
        /// <param name="unloadSceneCallbacks">卸载场景回调函数</param>
        /// <param name="userData">用户自定义数据</param>
        public abstract void UnloadScene(string sceneAssetName, UnloadSceneCallbacks unloadSceneCallbacks,
            object userData);
    }
}
